package com.ht.medicaltreatment.adapter

import android.widget.ImageView
import com.blankj.utilcode.util.LogUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.TransportRfidSampleBox

class CaiYangAdapter:BaseQuickAdapter<TransportRfidSampleBox,BaseViewHolder>(R.layout.item_caiyang_layout) {
    override fun convert(holder: BaseViewHolder, item: TransportRfidSampleBox) {
        val imgIcon = holder.getView<ImageView>(R.id.imgIcon)
        holder.setText(R.id.tvName,item.name)
        if(item.position?.isNotEmpty() == true){
            holder.setText(R.id.tvLocation,item.position)
        }
        if(item.transportStatus == 0){
            //未盘点
            imgIcon.setBackgroundResource(R.drawable.icon_ybh_gray)
        }else{
            imgIcon.setBackgroundResource(R.drawable.icon_ybh_green)
        }
    }

}
